//
//  SaveDeviceInstallInfoAPI.m
//  HerconWaterFilter
//
//  Created by Kendama on 2017/5/10.
//  Copyright © 2017年 JianWei Chen. All rights reserved.
//

#import "SaveDeviceInstallInfoAPI.h"

@implementation SaveDeviceInstallInfoAPI{
    NSDictionary *_dic;
}

-(id)initWithDic:(NSDictionary *)dic{
    if (self = [super init]) {
        _dic = dic;
    }
    return self;
}

- (NSString *)requestUrl {
    return @"device/save_device_install_info";
}

- (YTKRequestMethod)requestMethod {
    return YTKRequestMethodPOST;
}

- (id)requestArgument {
    NSMutableDictionary *dic = [NSMutableDictionary getPubdic];

    if (_dic[@"imei"]) {
        [dic setObject:_dic[@"imei"] forKey:@"imei"];
        
    }
    if (_dic[@"contact"]) {
        [dic setObject:_dic[@"contact"] forKey:@"contact"];
        
    }
    if (_dic[@"contact_number"]) {
        [dic setObject:_dic[@"contact_number"] forKey:@"contact_number"];
        
    }
    if (_dic[@"province"]) {
        [dic setObject:_dic[@"province"] forKey:@"province"];
        
    }
    if (_dic[@"city"]) {
        [dic setObject:_dic[@"city"] forKey:@"city"];
        
    }
    if (_dic[@"district"]) {
        [dic setObject:_dic[@"district"] forKey:@"district"];
        
    }
    if (_dic[@"address"]) {
        [dic setObject:_dic[@"address"] forKey:@"address"];
        
    }
    NSString *sign=[NSString getSign:dic];
    [dic setObject:sign forKey:@"sign"];
    return dic;
    
}

- (NSString *)userId {
    return [[[self responseJSONObject] objectForKey:@"userId"] stringValue];
}

-(void)dealloc
{
    NSLog(@"AddDeviceApi dealloc");
}


@end
